<?php

/**
 * ProductDetailField filter form base class.
 *
 * @package    Onnobostro
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseProductDetailFieldFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'product_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Product', 'add_empty' => true)),
      'size_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'ProductSize', 'add_empty' => true)),
      'name'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'A:Body Length' => 'A:Body Length', 'B:Half Chest Width' => 'B:Half Chest Width', 'C:Sleeve Length' => 'C:Sleeve Length', 'D:Shoulder to Shoulder' => 'D:Shoulder to Shoulder', 'E:Collar Opening' => 'E:Collar Opening', 'F:Cuff/Sleeve Opening' => 'F:Cuff/Sleeve Opening', 'F:Sleeve Opening' => 'F:Sleeve Opening', 'B:Half Chest Width Upper' => 'B:Half Chest Width Upper', 'F:Half Chest (Lower)' => 'F:Half Chest (Lower)', 'A:Length' => 'A:Length', 'B:Waist (Normal)' => 'B:Waist (Normal)', 'C:Stretched Waist' => 'C:Stretched Waist', 'D:Half Width at Upper' => 'D:Half Width at Upper', 'E:Bottom Opening' => 'E:Bottom Opening', 'A:Waist Opening' => 'A:Waist Opening', 'B:Length' => 'B:Length', 'C:Thigh' => 'C:Thigh', 'D:Bottom Open' => 'D:Bottom Open', 'E:Height at Crotch' => 'E:Height at Crotch'))),
      'value'      => new sfWidgetFormDmFilterInput(),
    ));

    $this->setValidators(array(
      'product_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Product'), 'column' => 'id')),
      'size_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ProductSize'), 'column' => 'id')),
      'name'       => new sfValidatorChoice(array('required' => false, 'choices' => array('A:Body Length' => 'A:Body Length', 'B:Half Chest Width' => 'B:Half Chest Width', 'C:Sleeve Length' => 'C:Sleeve Length', 'D:Shoulder to Shoulder' => 'D:Shoulder to Shoulder', 'E:Collar Opening' => 'E:Collar Opening', 'F:Cuff/Sleeve Opening' => 'F:Cuff/Sleeve Opening', 'F:Sleeve Opening' => 'F:Sleeve Opening', 'B:Half Chest Width Upper' => 'B:Half Chest Width Upper', 'F:Half Chest (Lower)' => 'F:Half Chest (Lower)', 'A:Length' => 'A:Length', 'B:Waist (Normal)' => 'B:Waist (Normal)', 'C:Stretched Waist' => 'C:Stretched Waist', 'D:Half Width at Upper' => 'D:Half Width at Upper', 'E:Bottom Opening' => 'E:Bottom Opening', 'A:Waist Opening' => 'A:Waist Opening', 'B:Length' => 'B:Length', 'C:Thigh' => 'C:Thigh', 'D:Bottom Open' => 'D:Bottom Open', 'E:Height at Crotch' => 'E:Height at Crotch'))),
      'value'      => new sfValidatorPass(array('required' => false)),
    ));
    

    $this->widgetSchema->setNameFormat('product_detail_field_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProductDetailField';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'product_id' => 'ForeignKey',
      'size_id'    => 'ForeignKey',
      'name'       => 'Enum',
      'value'      => 'Text',
    );
  }
}
